<script src="sys/menu.js"></script>
<div id="dg_menu_toolbar">
    <div style="padding: 10px;">
        <form id="searMenuParams">
            <!--<label>ID:</label><input class="easyui-validatebox" type="number" name="menu.id"/>
            <label>菜单名称:</label><input class="easyui-validatebox" type="text" name="menu.name"/>-->
            <label>父级ID:</label><input class="easyui-validatebox" type="text" name="menu.parent_id"/>
        </form>
    </div>
    <span onclick="searchMenu()" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</span>
    <span onclick="addMenu()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</span>
    <span onclick="updateMenu()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</span>
    <span onclick="removeMenu()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</span>
</div>
<table class="easyui-treegrid" id="dg_menu"
       data-options="fit:true,fitColumns:true,singleSelect:true,pagination:false,toolbar:'#dg_menu_toolbar'">
    <thead>
    <tr>
        <th data-options="field:'id',width:100">ID</th>
        <th data-options="field:'name',width:100">菜单名</th>
        <th data-options="field:'url',width:100">URL</th>
        <th data-options="field:'parentId',width:100">父级ID</th>
        <th data-options="field:'status',width:100,formatter:displayState">状态</th>

    </tr>
    </thead>
</table>

<div id="dl_menu_edit" class="easyui-dialog" closed="true" title="编辑菜单" style="width:400px;height:400px; padding: 10px"
     data-options="resizable:true,modal:true,buttons:'#tb_menu_edit',inline:true">
    <form id="form_menu_edit" method="post">
        <div class="mb10">
            <label>ID:</label>
            <input class="easyui-validatebox" type="number" name="id" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label>菜单名称:</label>
            <input class="easyui-validatebox" type="text" name="name" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label>URL:</label>
            <input class="easyui-validatebox" type="text" name="url" data-options=""/>
        </div>
        <div class="mb10">
            <label>父级ID:</label>
            <input class="easyui-validatebox" type="text" name="parentId" data-options=""/>
        </div>
        <div class="mb10">
            <label>状态:</label>
            <select name="state">
                <option value="1">启用</option>
                <option value="0">禁用</option>
            </select>
        </div>
    </form>
</div>
<div id="tb_menu_edit">
    <span onclick="submitMenu()" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true">提交</span>
    <span onclick="closeEdit()" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">取消</span>
</div>

